The present invention relates generally to object-oriented development of database applications and more specifically to dynamic component activation through the use of a database as a repository for registration information.
Prior to this invention, component registration under the Microsoft Windows operating system was achieved with the Service Control Manager (SCM). However, the SCM is very tightly coupled to Microsoft""s Component Object Model (COM), and therefore to the windows platform. This mechanism is generally not available in other platforms and must be used in conjunction with COM.
There are other well-known mechanisms that may be used for registering component information. Directory services, naming services, and location brokers can be used for this purpose. However, these services are complex and not easily understood, difficult to manage, and may perform poorly. In addition, these services cannot be used by an application to load functionality dynamically without additional software development.
There is therefore an unmet need in the field for a simple and robust technique for dynamic component activation that operates under multiple operating systems, including Microsoft Windows NT(trademark) and Unix. A useful dynamic component activation method should be transparent to the calling application, only requiring that the application have knowledge of the name or unique identifier for the objects that need to be loaded. The details of how the dynamic libraries are loaded and the components activated should preferably scale across a distributed and heterogeneous computing environment.
Therefore, in accordance with an embodiment of the present invention, a method for dynamic component activation using one or more databases as a repository for registration information in an application in a heterogeneous and distributed computing environment is disclosed. This method comprises launching the application, creating and initializing a Component Activation Manager (CAM), opening a database connection using the CAM, requesting functionality not currently available in the application using the database connection; using the CAM and the database connection to find and return the requested functionality, which may be encapsulated in an object factory, and loading the requested functionality to extend the application. The CAM, which may be contained in one or more dynamic libraries, is preferably created and initialized when the application is launched.
Using the CAM and the database connection to find and return the requested object factory may further comprise the database connection object looking up the requested object factory in the connection table, the database connection object returning the requested object factory if it is in the connection table, the database connection object sending a message to the CAM to obtain a factory creation factor (FCF) for the requested object if said requested object factory is not in the connection table, and, if requested factory object is not associated with the current database connection, the database connection object sending a message to the dynamic library to create an instance of the object factory using the FCF and receiving the instance of the object factory. The FCF creates images of the objects of the connection table in memory which may then be used as a factory of the objects.
A structure for dynamic component activation using databases as the repository for registration information in an application in a heterogeneous computing environment is also disclosed. The application is coupled to objects that provide the functionality for dynamic component activation. One or more database connection objects are coupled to one or more local databases, one or more remote databases, and the application. The structure further includes a Component Activation Manager (CAM) that is coupled to the one or more database connection objects, dynamic libraries that are coupled to the one or more local databases and the one or more remote databases, factory creation objects, and class objects coupled to the application via the database connection objects. The factory creation objects are contained in the dynamic libraries and are coupled to the CAM via the database connection objects. The class objects are created through the use of the factory creation objects and the dynamic libraries.